<?php
namespace App\Admin\Models;
use Common\BaseModel;
class WwwExtend extends BaseModel
{
    public $res;
    public $expire;

    public function getSource()
    {
        return "f_users_extend";
    }

    public function find_by_user_id($userId){
        $res = $this->findFirstByUserId($userId);
        if(!$res){
            $this->user_id = $userId;
            $this->save();
            $res = $this->findFirstByUserId($userId);
        }
        return $res;
    }


    public function get_sync_list(){
        $conditions = 'level_id>=2';
        $get_list = $this->find(array(
           $conditions
        ));
        return $get_list;
    }

}
